#include <iostream>
#include <vector>

int add(int a, int b)
{
    return a + b;
}

int div2(int a, int b)
{
    return a - b;
}

//int (*p)(int, int);
typedef decltype(add) *p;

// int use_add(int a, int b, int p(int,int))
int use_add(int a, int b, p func)
{
    return func(a, b);
}

int main()
{
    //std::vector<decltype(p)> res;
    std::vector<p> res;
    res.push_back(add);
    res.push_back(div2);

    std::cout << res[0](1,1) << std::endl;
    std::cout << res[1](2,2) << std::endl;

    std::cout << use_add(3,4, add) << std::endl;
    return 0;
}